from django.conf.urls import include, url
from rest_framework_swagger.views import get_swagger_view
# from rest_framework.schemas import get_schema_view
from rest_framework.documentation import include_docs_urls
from rest_framework import routers
from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token, verify_jwt_token



from users import views


API_TITLE = 'Swagger API'
API_DESCRIPTION = 'A Web API for creating and viewing highlighted code snippets.'
# schema_view = get_schema_view(title=API_TITLE)

schema_view = get_swagger_view(title='Pastebin API')

router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)

# router.register(r'users', views.UserViewSet)


urlpatterns = [
    # url(r'^', include('snippets.urls')),
    url(r'^api/', include(router.urls)),
    url(r'^api/login/', obtain_jwt_token),
    url(r'^api-token-verify/', verify_jwt_token),
    url(r'^api-token-refresh/', refresh_jwt_token),
    url(r'^api/register/$', views.UserRegisterAPIView.as_view()),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),

    url(r'^schema/$', schema_view),
    url(r'^docs/', include_docs_urls(title=API_TITLE, description=API_DESCRIPTION))
]
